
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>TNF 北面后台管理系统</title>
    <meta name="_token" content="C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC"/>
    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/css/plugins/iCheck/custom.css" rel="stylesheet">

    <!-- Toastr style -->
    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/css/plugins/toastr/toastr.min.css" rel="stylesheet">

    <link media="all" type="text/css" rel="stylesheet" href="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/sweetalert/sweetalert.css">

    <!-- Gritter -->
    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
    <link href="base.css" rel="stylesheet">

    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/css/animate.css" rel="stylesheet">
    <link href="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/css/style.css" rel="stylesheet">

    <link media="all" type="text/css" rel="stylesheet" href="http://admin.dev.tnf.ibrand.cc/assets/backend/css/main.css">

    <script>
        window.AppUrl = "http://admin.dev.tnf.ibrand.cc";
        window._token = "C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC";
    </script>
    <link media="all" type="text/css" rel="stylesheet" href="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/webuploader-0.1.5/webuploader.css">

    <link media="all" type="text/css" rel="stylesheet" href="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/Tagator/fm.tagator.jquery.css">

    <script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/md5.js"></script>

    <style type="text/css">
        .filelist {
            clear: both;
            width: 100%;
            float: left;
            padding-bottom: 20px;
        }

        .filelist li {
            list-style: none;
            text-align: center;
            margin-right: 12px;
            float: left;
            width: 103px;
            height: 103px
        }

        .filelist li img {
            width: 100px;
            height: 100px
        }

        .filelist .current {
            border: 3px #f60 solid;
        }

        #sku-builder .color-block {
            display: inline-block;
            width: 12px;
            height: 12px;
            border: 1px solid #cccccc;
            border-radius: 2px;
            margin-right: 3px;
        }
        div#containerpc,div#container{overflow: hidden}


        .inputAdd {

            width:50%;
            display: inline-block;
            max-width: 100%;
            margin-bottom: 5px;
            height:20px;

        }
    </style>

</head>

<body>
<div id="wrapper">
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav metismenu" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element"> <span>
                            <img alt="image" style="width: 48px;" class="img-circle" src=""/>
                             </span>

                    </div>

                    <div class="logo-element">
                        TNF 北面
                    </div>
                </li>



                <li class="">
                    <a href="#"><i class="fa fa-gear"></i>
                        <span class="nav-label">商城设置</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/setting/shopSetting">商城设置</a></li>

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/setting/point">积分设置</a></li>


                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/setting/price/protection">价格保护</a></li>

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/setting/employee">员工内购</a></li>

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/setting/refund-reason">退换货理由设置</a></li>




                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/setting/tool">工具管理</a></li>

                    </ul>
                </li>







                <li class="active">
                    <a href="#"><i class="fa fa-desktop"></i>
                        <span class="nav-label">商品管理</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/models">模型管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/specs"> 规格管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/attribute"> 参数管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/brand"> 品牌管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/category_group"> 分类管理</a></li>
                        <li class="active"><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/goods"> 商品列表</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/store/registrations"> 商品注册码</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/cart"> 购物车列表</a></li>
                    </ul>
                </li>

                <li class="">
                    <a href="#"><i class="fa fa-star"></i>
                        <span class="nav-label">促销管理</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/promotion/discount">促销活动管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/promotion/coupon">优惠券管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/promotion/single-discount"> 单品折扣管理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/promotion/bundle"> 套餐列表</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/promotion/bundle/create"> 添加套餐</a></li>

                    </ul>
                </li>

                <li class="">
                    <a href="#"><i class="fa fa-star"></i>
                        <span class="nav-label">事件营销管理</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/marketing/GOODS_REGISTER/list">商品注册事件管理</a></li>



                    </ul>
                </li>

                <li class="">
                    <a href="#"><i class="fa fa-database"></i>
                        <span class="nav-label">订单管理</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/order?status=all">订单列表</a></li>

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/offOrders">线下订单数据列表 </a></li>

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/refund">退换货管理</a></li>

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/comments?status=show">评论管理</a></li>



                    </ul>
                </li>

                <li class="">
                    <a href="#"><i class="fa fa-ship"></i>
                        <span class="nav-label">物流管理</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">

                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/shippingmethod/shippingmethod/company">物流列表</a></li>


                    </ul>
                </li>



                <li class="">
                    <a href="#"><i class="fa fa-ship"></i>
                        <span class="nav-label">ERP管理</span>
                        <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/erp/all-orders?status=2">ERP 手动推单</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/erp/order">失败订单处理</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/erp/log">ERP日志列表</a></li>
                    </ul>
                </li>
                <li class=" ">
                    <a href="#"><i class="fa fa-adn"></i>
                        <span class="nav-label">数据导入</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level collapse">
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/dataimport/createOrder">线下订单数据导入</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/dataimport/createVipeak">线下会员卡数据导入</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/dataimport/createCoupon">线下优惠券数据导入</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/dataimport/createWebCouponCode">官网优惠码数据导入</a></li>
                    </ul>
                </li>

                <li class=" ">
                    <a href="#"><i class="fa fa-adn"></i>
                        <span class="nav-label">微信卡券管理</span>
                        <span class="fa arrow"></span>
                    </a>
                    <ul class="nav nav-second-level collapse">
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/wechat/card">卡券列表</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/wechat/landingPage">货架列表</a></li>
                        <li class=""><a
                                href="http://admin.dev.tnf.ibrand.cc/admin/wechat/mate">素材列表</a></li>

                    </ul>
                </li>



            </ul>
        </div>
    </nav>

    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="javascript:;"><i
                            class="fa fa-bars"></i> </a>
                </div>

                <ul class="nav navbar-nav top-navbar">

                    <li>
                        <a href="http://admin.dev.tnf.ibrand.cc/admin/dash">
                            仪表盘
                        </a>
                    </li>
                    <li>
                        <a href="http://admin.dev.tnf.ibrand.cc/admin/setting">
                            系统设置
                        </a>
                    </li>
                    <li>
                        <a href="http://admin.dev.tnf.ibrand.cc/admin/member/users">
                            会员管理
                        </a>
                    </li>
                    <li class="active">
                        <a href="http://admin.dev.tnf.ibrand.cc/admin/store">
                            商城管理
                        </a>
                    </li>
                    <li>
                        <a href="http://admin.dev.tnf.ibrand.cc/admin/cms">
                            内容管理
                        </a>
                    </li>

                </ul>

                <ul class="nav navbar-top-links navbar-right">
                    <li>
                        <span class="m-r-sm text-muted welcome-message">欢迎使用TNF 北面后台管理系统.</span>
                    </li>

                    <li>










                        <a data-toggle="dropdown" class="dropdown-togg" href="graph_morris.html#">
                            <span class="block m-r-sm"> <strong class="font-bold">yichanghong@admin.com<b class="caret"></b></strong>
                             </span>  </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a href="#" data-toggle="modal" data-target="#resetPassword"><i class="fa fa-pencil-square-o"></i>修改密码</a></li>
                            <!-- Modal -->
                            <div class="modal fade" id="resetPassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                            <h4 class="modal-title" id="myModalLabel">修改密码</h4>
                                        </div>
                                        <form action="http://admin.dev.tnf.ibrand.cc/admin/password/reset" method="POST" role="form" id="resetPasswordForm">
                                            <div class="modal-body">
                                                <div class="form-group">
                                                    <label for="old_password">旧密码</label>
                                                    <input type="password" class="form-control" name="old_password" id="old_password" placeholder="旧密码">
                                                </div>
                                                <div class="form-group">
                                                    <label for="password">新密码</label>
                                                    <input type="password" class="form-control" name="password" id="password" placeholder="新密码">
                                                </div>
                                                <div class="form-group">
                                                    <label for="password_confirmation">确认密码</label>
                                                    <input type="password" class="form-control" name="password_confirmation" id="password_confirmation" placeholder="新密码">
                                                </div>


                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                <button type="submit" class="btn btn-primary">保存</button>
                                            </div>
                                            <input type="hidden" name="_token" value="C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC">
                                        </form>
                                    </div>
                                </div>
                            </div>


                            <li class="divider"></li>
                            <li>
                                <a href="http://admin.dev.tnf.ibrand.cc/admin/logout"
                                   onclick="event.preventDefault();
                                                 document.getElementById('logout-form').submit();">
                                    <i class="fa fa-sign-out"></i>退出
                                </a>

                                <form id="logout-form" action="http://admin.dev.tnf.ibrand.cc/admin/logout" method="POST" style="display: none;">
                                    <input type="hidden" name="_token" value="C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC">
                                </form>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="row wrapper border-bottom white-bg page-heading">

            <div class="col-lg-10">
                <h2>新建商品</h2>
                <ol class="breadcrumb">
                    <li><a href="http://admin.dev.tnf.ibrand.cc/admin/store"><i class="fa fa-dashboard"></i> 首页</a></li>
                    <li class="active">新建商品</li>
                </ol>

            </div>
            <div class="col-lg-2">

            </div>

        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">


                    <div class="tabs-container">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">款式信息（SPU）<i
                                    class="glyphicon"></i></a></li>
                            <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">规格信息（SKU）<i class="glyphicon"></i></a>
                            </li>
                            <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">详细描述(Mobile)</a></li>
                            <li class=""><a href="#tab_6" data-toggle="tab" aria-expanded="false">详细描述(PC)</a></li>
                            <li class=""><a href="#tab_8" data-toggle="tab" aria-expanded="false">推荐搭配</a></li>
                            <li class=""><a href="#tab_4" data-toggle="tab" aria-expanded="false">橱窗图</a></li>
                            <li class=""><a href="#tab_5" data-toggle="tab" aria-expanded="false">SEO设置</a></li>

                            <li class=""><a href="#tab_7" data-toggle="tab" aria-expanded="false">积分规则</a></li>

                            <li class=""><a href="#tab_9" data-toggle="tab" aria-expanded="false">商品视频</a></li>
                        </ul>

                        <form method="POST" action="http://admin.dev.tnf.ibrand.cc/admin/store/goods/store" accept-charset="UTF-8" id="base-form" class="form-horizontal"><input name="_token" type="hidden" value="C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC">
                            <div class="tab-content">

                                <div class="tab-pane active" id="tab_1">
                                    <div class="panel-body">
                                        <input type="hidden" name="id" value="0">
                                        <input type="hidden" name="img" value="">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">商品名称：</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="name" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">商品品牌：</label>
                                            <div class="col-sm-10">
                                                <select class="form-control" name="brand_id">
                                                    <option value="">请选择</option>
                                                    <option value="1">The North Face® 北面</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">分类组：</label>
                                            <div class="col-sm-10">
                                                <select class="form-control" name="category_group">
                                                    <option value="">请选择分类组</option>
                                                    <option value="1">北面商品分类</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">所属分类：</label>
                                            <div class="col-sm-10" id="category-box">














                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">商品数量：</label>
                                            <div class="col-sm-10">
                                                <input type="number" class="form-control" name="store_nums" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">商品编号：</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="goods_no" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">市场价：</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="market_price" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">销售价：</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="sell_price" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">是否上架：</label>
                                            <div class="col-sm-10">
                                                <input name="is_del" type="radio" value="0" checked=checked/> 是
                                                <input name="is_del" type="radio" value="2"/> 否
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">是否共享：</label>
                                            <div class="col-sm-10">
                                                <input name="is_share" type="radio" value="1" checked=checked/> 是
                                                <input name="is_share" type="radio" value="0"/> 否
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">是否赠品：</label>
                                            <div class="col-sm-10">
                                                <input name="is_largess" type="radio" value="1"/> 是
                                                <input name="is_largess" type="radio" value="0" checked/> 否
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">是否推荐：</label>
                                            <div class="col-sm-10">
                                                <input name="is_commend" type="radio" value="1"/> 是
                                                <input name="is_commend" type="radio" value="0" checked/> 否
                                            </div>
                                        </div>


                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">是否新品：</label>
                                            <div class="col-sm-10">
                                                <input name="is_old" type="radio" value="0" checked/> 是
                                                <input name="is_old" type="radio" value="1" /> 否
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">商品模型：</label>
                                            <div class="col-sm-10">
                                                <select class="form-control" name="model_id" onchange="create_attr(this.value)">
                                                    <option value="">请选择产品模型</option>
                                                    <option value="1">旧服饰模型</option>
                                                    <option value="3">男鞋</option>
                                                    <option value="4">女鞋</option>
                                                    <option value="5">上装</option>
                                                    <option value="6">男下装</option>
                                                    <option value="7">女下装</option>
                                                    <option value="8">童装</option>
                                                    <option value="9">包类</option>
                                                    <option value="10">配件</option>
                                                    <option value="11">cesh11</option>
                                                </select>
                                                <label>可以加入商品参数，比如：型号，年代，款式...【商品一经发布无法修改】</label>
                                            </div>

                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">商品参数：</label>
                                            <div class="col-sm-10" id="propert_table">

                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">产品标签：</label>
                                            <div class="col-sm-10">
                                                <input class="form-control form-inputTagator col-sm-10" id="inputGoodsTags" placeholder="" name="tags" type="text" value="">
                                                <label>输入产品标签名称，按回车添加</label>
                                            </div>
                                        </div>


                                    </div>
                                </div><!-- /.tab-pane -->


                                <div class="tab-pane" id="tab_3">
                                    <div class="panel-body">
                                        <script type="text/html" id="template-spec">
                                            <div class="col-sm-4 col-md-3 col-lg-3">
                                                <label>
                                                    <input type="checkbox" value="{#id#}" name="spec_id_{#sid#}[]" data-uuid="{#sid#}-{#id#}" icheck-name="spec_{#sid#}_{#id#}" {#checked#}>
                                                    {#block#}
                                                </label>
                                                {#textInput#}
                                            </div>
                                        </script>

                                        <script type="text/html" id="template-spec-list">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">{#label#}:</label>
                                                <div class="col-sm-10" id="spec-list-{#id#}">
                                                    {#html#}
                                                </div>
                                            </div>
                                        </script>

                                        <script type="text/html" id="template-sku-tr">
                                            <td><input type="text" data-name="market_price" data-action="save" value="{#market_price#}" name="_spec[{#index#}][market_price]"></td>
                                            <td>
                                                <input type="hidden" data-name="id" data-action="save" value="{#id#}" name="_spec[{#index#}][id]">
                                                <input type="hidden" data-name="specID" data-action="save" value="{#spec#}" name="_spec[{#index#}][specID]">

                                                <input type="text" data-name="sell_price" data-action="save" value="{#sell_price#}" name="_spec[{#index#}][sell_price]"></td>
                                            <td><input type="text" data-name="store_nums" data-action="save" value="{#store_nums#}" name="_spec[{#index#}][store_nums]"></td>
                                            <td><input type="text" data-name="code" data-action="save" value="{#sku#}" name="_spec[{#index#}][sku]"></td>
                                            <!--<td class="image" colspan="{#count#}">-->
                                                <!--<div class="block{#class#}">{#imgTag#}</div>-->
                                                <!--<label class="block img-plus">-->
                                                    <!--<span class="glyphicon glyphicon-plus"></span>-->
                                                    <!--<input type="file" name="upload_image" accept="image/*">-->
                                                <!--</label>-->
                                            <!--</td>-->
                                            <td>

                                                <a><i class="fa switch {#switch_class#}" title="切换状态">
                                                    <input type="hidden" value="{#is_show#}" name="_spec[{#index#}][is_show]">
                                                </i>
                                                </a>
                                            </td>
                                        </script>

                                        <script type="text/html" id="template-img-table">
                                            <label class="col-sm-2 control-label">颜色图片:</label>
                                            <div class="col-sm-10">
                                                <table class="table table-bordered" id="image-table">
                                                    <thead>
                                                    <tr>
                                                        <th style="width: 30%">颜色分类</th>
                                                        <th style="width: 30%">自定义名称</th>
                                                        <th>图片</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody>
                                                    <!--自由填充-->
                                                    </tbody>
                                                </table>
                                            </div>
                                        </script>

                                        <script type="text/html" id="template-img-tr">
                                            <tr data-id="{#id#}" data-sid="{#sid#}">
                                                <td>
                                                    {#block#}
                                                </td>
                                                <td>
                                                    <input type="text" data-id="{#id#}" data-sid="{#sid#}" data-action="update" value="{#alias#}" name="spec_alias[{#id#}]" />
                                                </td>
                                                <td class="image">
                                                    <div class="block{#class#}">{#imgTag#}</div>
                                                    <label class="block img-plus">
                                                        <span class="glyphicon glyphicon-plus"></span>
                                                        <input type="file" name="upload_image" accept="image/*">
                                                    </label>
                                                </td>
                                            </tr>
                                        </script>
                                        <div id="sku-builder">

                                            <div id="module-specs">

                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">批量填充：</label>

                                                <div class="form-group col-sm-3">
                                                    <div class="input-group m-b"><span class="input-group-addon">市场价:</span>
                                                        <input class="form-control" type="text" id="market-price" placeholder="请输入销售价格" data-name="market_price"
                                                               data-action="batch">
                                                    </div>
                                                </div>
                                                <div class="form-group col-sm-1"></div>
                                                <div class="form-group col-sm-3">
                                                    <div class="input-group m-b"><span class="input-group-addon">销售价:</span>
                                                        <input class="form-control" type="text" id="all-price" placeholder="请输入销售价格" data-name="sell_price"
                                                               data-action="batch">
                                                    </div>
                                                </div>
                                                <div class="form-group col-sm-1"></div>
                                                <div class="form-group col-sm-2">
                                                    <div class="input-group m-b"><span class="input-group-addon">数量:</span>
                                                        <input class="form-control" type="text" id="all-quantity" placeholder="请输入数量" data-name="store_nums"
                                                               data-action="batch">
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">产品列表：</label>
                                                <div class="col-sm-10">

                                                    <table class="table table-bordered" id="sku-table">
                                                        <thead>
                                                        <tr>
                                                            <!--规格-->
                                                            <th>图片</th>
                                                            <th>市场价</th>
                                                            <th>销售价</th>
                                                            <th>数量</th>
                                                            <th>SKU</th>
                                                            <th>操作</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody>
                                                        <!--数据列表-->
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>

                                        </div>                </div>
                                </div>


                                <div class="tab-pane" id="tab_2">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">内容同步设置：</label>
                                            <div class="col-sm-10">
                                                <input name="sync" type="radio" value="0" checked/> 不同步
                                                <input name="sync" type="radio" value="1"/> 同步至PC端
                                            </div>
                                        </div>

                                        <script id="container" name="content"
                                                type="text/plain"></script>
                                    </div>

                                </div><!-- /.tab-pane -->

                                <style type="text/css">
                                    /*#filePicker,.webuploader-pick{display: block; z-index: 9999; position: absolute;}*/
                                </style>
                                <div class="tab-pane" id="tab_4">
                                    <div class="panel-body">

                                        <div class="table-responsive">
                                            <table class="table table-bordered table-stripped" id="mp_menu_table">
                                                <thead>
                                                <tr>
                                                    <th>
                                                        主图
                                                    </th>
                                                    <th>
                                                        预览
                                                    </th>
                                                    <th>
                                                        图片链接
                                                    </th>
                                                    <th>
                                                        SKU
                                                    </th>
                                                    <th>
                                                        排序(数字越大排在越前)
                                                    </th>
                                                    <th>
                                                        是否显示
                                                    </th>
                                                    <th>
                                                        操作
                                                    </th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                </tbody>
                                            </table>
                                        </div>
                                        <div class="form-group">

                                            <div class="col-sm-12">
                                                <div id="filePicker">选择图片</div>
                                                <div class="clearfix"></div>
                                            </div>
                                        </div>
                                        <script type="text/x-template" id="top_menu_template">
                                            <tr data-id="{MENU_ID}" class="top_menu" id="menu_id_{MENU_ID}">
                                                <td valign="middle">
                                                    <input name="_is_default" type="radio" value="{MENU_ID}"  />
                                                </td>
                                                <td>
                                                    <img src="{url}" style="max-width: 100px;">
                                                </td>
                                                <td>
                                                    <input type="hidden" name="_imglist[{MENU_ID}][url]" value="{url}">
                                                    <input type="text" class="form-control" disabled="" value="{url}">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control" name="_imglist[{MENU_ID}][sku]" value="">
                                                </td>
                                                <td>
                                                    <input type="text" class="form-control" name="_imglist[{MENU_ID}][sort]" value="9">
                                                </td>
                                                <td>
                                                    <input name="_imglist[{MENU_ID}][flag]" type="radio" value="1" checked=checked /> 是
                                                    <input name="_imglist[{MENU_ID}][flag]" type="radio" value="0"  /> 否
                                                </td>
                                                <td>
                                                    <a href="javascript:;" class="btn btn-white"
                                                       onclick="$(this).parents('tr').remove();"><i class="fa fa-trash"></i>
                                                    </a>
                                                </td>
                                            </tr>
                                        </script>
                                    </div>

                                </div><!-- /.tab-pane -->
                                <div class="tab-pane" id="tab_5">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">SEO关键词：</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="keywords" placeholder="">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">SEO描述：</label>
                                            <div class="col-sm-10">
                                                <textarea class="form-control" name="description" placeholder=""></textarea>

                                            </div>
                                        </div>
                                    </div>

                                </div><!-- /.tab-pane -->

                                <div class="tab-pane" id="tab_6">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">内容同步设置：</label>
                                            <div class="col-sm-10">
                                                <input name="sync" type="radio" value="2"/> 同步至移动端
                                            </div>
                                        </div>

                                        <script id="containerpc" name="contentpc"
                                                type="text/plain"></script>
                                    </div>

                                </div><!-- /.tab-pane -->

                                <div class="tab-pane" id="tab_8">
                                    <div class="panel-body">
                                        <script id="collocation" name="collocation"
                                                type="text/plain"></script>
                                    </div>
                                </div><!-- /.tab-pane -->

                                <div class="tab-pane" id="tab_7">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">参与积分：</label>
                                            <div class="col-sm-10">
                                                <input type="radio" class="form-control" name="point_status" value="0" checked="checked">
                                                不参与
                                                <input type="radio" class="form-control" name="point_status" value="1"> 参与
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">计算方式：</label>
                                            <div class="col-sm-10">
                                                <input type="radio" class="form-control" name="point_type" value="0" checked="checked"> 固定值
                                                <input type="radio" class="form-control" name="point_type" value="1"> 比例
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">积分数值：</label>
                                            <div class="col-sm-10">
                                                <input type="text" class="form-control" name="point_value" value="0">
                                                <p>说明：当计算方式为<b>比例</b>时，积分数值单位为 %</p>
                                            </div>
                                        </div>
                                    </div>

                                </div><!-- /.tab-pane -->

                                <div class="tab-pane" id="tab_9">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">视频背景：</label>
                                            <div class="col-sm-10">
                                                <input type="radio" class="form-control" name="extra[video][status]" value="1"> 启用
                                                <input type="radio" class="form-control" name="extra[video][status]" value="0" checked="checked"> 禁用
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <input type="hidden" name="extra[video][url]">

                                            <label class="col-sm-2 control-label">视频文件：</label>
                                            <div class="col-sm-10">
                                                <p id="videoOriginName"></p>
                                                <div id="videoPicker">选择视频</div>
                                                <div class="clearfix"></div>
                                            </div>
                                        </div>
                                    </div>

                                </div><!-- /.tab-pane -->


                                <div class="ibox-content m-b-sm border-bottom text-right">
                                    <input type="submit" class="btn btn-success" data-toggle="form-submit" data-target="#base-form"
                                           value="保存">


                                </div>


                            </div><!-- /.tab-content -->
                        </form>


                    </div>

                </div>
            </div>
        </div>
        <div class="footer">
            <div class="pull-right">
                <strong>上海艾游文化传播有限公司</strong>.
            </div>
            <div>
                <strong>Copyright</strong> TNF © 2015-2016
            </div>
        </div>
    </div>

</div>
<div class="popup">
    <div class="sortContainer">
        <p>请拖动标签进行排序，点击确认保存</p>
        <div class="sortMain">
            <ul id="sort">

            </ul>
        </div>
        <button class="btn btn-cancle sortCancle">取消</button>
        <button class="btn btn-success sortOK">确认</button>
    </div>
</div>
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/jquery-2.1.1.js"></script>
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/bootstrap.min.js"></script>


<script src="http://admin.dev.tnf.ibrand.cc/laravel-u-editor/ueditor.config.js"></script>
<script src="http://admin.dev.tnf.ibrand.cc/laravel-u-editor/ueditor.all.min.js"></script>

<script src="http://admin.dev.tnf.ibrand.cc/laravel-u-editor/lang/en/en.js"></script>;

<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/jquery.form.min.js"></script>

<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/webuploader-0.1.5/webuploader.js"></script>

<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/Tagator/fm.tagator.jquery.js"></script>


<script src="common.js"></script>
<script src="Sortable.js"></script>
<script src="spec.js"></script>




<script>
    var postImgUrl = 'http://admin.dev.tnf.ibrand.cc/admin/store/upload/image?_token=C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC';
    // 初始化Web Uploader
    $(document).ready(function () {
        // 初始化Web Uploader
        var uploader = WebUploader.create({
            auto: true,
            swf: 'http://admin.dev.tnf.ibrand.cc/assets/backend/libs/webuploader-0.1.5/Uploader.swf',
            server: 'http://admin.dev.tnf.ibrand.cc/admin/store/upload/image?_token=C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC',
            pick: '#filePicker',
            fileVal: 'upload_image',
            accept: {
                title: 'Images',
                extensions: 'gif,jpg,jpeg,bmp,png',
                mimeTypes: 'image/*'
            }
        });

        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
        uploader.on('uploadSuccess', function (file, response) {

            $('#mp_menu_table tbody').append($('#top_menu_template').html().replace(/{MENU_ID}/g, hex_md5(new Date().getTime() + '|' + Math.random())).replace(/{url}/g, response.url));
            $('#mp_menu_table tbody').find("input[type = 'radio']").iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
                increaseArea: '20%'
            });

            var info = uploader.getStats();
            if(info.progressNum == 0){
                uploader.reset();
            }
        });


        var uploader2 = WebUploader.create({
            auto: true,
            swf: 'http://admin.dev.tnf.ibrand.cc/assets/backend/libs/webuploader-0.1.5/Uploader.swf',
            server: 'http://admin.dev.tnf.ibrand.cc/files/upload?strategy=video&amp;_token=C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC',
            pick: '#videoPicker',
            fileVal: 'file',
            accept: {
                title: 'Video',
                extensions: 'mp4,wmv,avi,mpg,rmvb,m4v'
            }
        });

        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
        uploader2.on('uploadSuccess', function (file, response) {
            console.log(response);
            $('input[name="extra[video][url]"]').val(response.url);
            $('#videoOriginName').text(response.original_name);
        });

    });
</script>
<script>
    $(function () {
        $('#inputGoodsTags').tagator({
            autocomplete: ['标签提示1', '标签提示2', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth', 'tenth']
        });

        $('#filePicker').children().eq(0).css({'width': '90px', 'height': '30px'});

    });

</script>

<!-- Mainly scripts -->

<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/iCheck/icheck.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/inspinia.js"></script>
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/pace/pace.min.js"></script>

<!-- jQuery UI -->


<!-- GITTER -->
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/gritter/jquery.gritter.min.js"></script>

<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/sweetalert/sweetalert.min.js"></script>

<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/jquery.form.min.js"></script>




<!-- Toastr -->
<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/admin/js/plugins/toastr/toastr.min.js"></script>


<script src="http://admin.dev.tnf.ibrand.cc/assets/backend/libs/plugins.js"></script>


<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container',{
        autoHeightEnabled:false,
        initialFrameHeight:500
    });
    ue.ready(function() {
        ue.execCommand('serverparam', '_token', 'C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC');//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.

    });

    var uepc = UE.getEditor('containerpc',{
        autoHeightEnabled:false,
        initialFrameHeight:500
    });
    uepc.ready(function() {
        uepc.execCommand('serverparam', '_token', 'C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC');//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.
    });

    var ue_collocation = UE.getEditor('collocation',{
        autoHeightEnabled:false,
        initialFrameHeight:500
    });
    ue_collocation.ready(function() {
        ue_collocation.execCommand('serverparam', '_token', 'C8QLGeVvJinNxJUnyUxkuCm1z3uNx0UgBQ5CHOYC');//此处为支持laravel5 csrf ,根据实际情况修改,目的就是设置 _token 值.
    });
</script>
<script>

    $('#base-form').ajaxForm({
        success: function (result) {
            if(!result.status)
            {
                swal("保存失败!", result.error, "error")
            }else{
                swal({
                    title: "保存成功！",
                    text: "",
                    type: "success"
                }, function() {
                    location = 'http://admin.dev.tnf.ibrand.cc/admin/store/goods';
                });
            }

        }

    });

    /**
     * 设置商品默认图片
     */
    function defaultImage(_self)
    {
        $('.filelist img').removeClass('current');
        $(_self).addClass('current');
        $('input[name="img"]').val($('.filelist img[class="current"]').attr('src'));
    }


    //根据模型动态生成扩展属性
    function create_attr(model_id)
    {
        $('#speccontent').html("");
        var tempUrl = 'http://admin.dev.tnf.ibrand.cc/admin/store/goods/getAttribute';
        var postData = {
            model_id: model_id,
            _token:$('meta[name="_token"]').attr('content')
        };

//        $.post(tempUrl, postData, function (ret) {
//            $('#propert_table').html(ret);
//        });
        var ret = `<table class="table table-bordered table-striped dataTable" >

        <tr>
        <th>系列</th>
        <td>
                            <input type="text" name="attr_id_8" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>性别</th>
        <td>
                            <input type="text" name="attr_id_9" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>适合季节</th>
        <td>
                            <input type="text" name="attr_id_10" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>适用活动</th>
        <td>
                            <input type="text" name="attr_id_11" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>上市时间</th>
        <td>
                            <input type="text" name="attr_id_12" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>商品科技</th>
        <td>
                            <input type="text" name="attr_id_13" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>商品功能</th>
        <td>
                            <input type="text" name="attr_id_14" class="form-control"/>
                    </td>
    </tr>
    <tr>
        <th>专业指数</th>
        <td>
                            <select class="form-control" name="attr_id_81">
                    <option value="0">请选择</option>
                                            <option value="45">入门级</option>
                                            <option value="46">高性价比</option>
                                            <option value="47">专业级</option>
                                    </select>
                    </td>
    </tr>
    <tr>
        <th>鞋子重量</th>
        <td>
                            <select class="form-control" name="attr_id_82">
                    <option value="0">请选择</option>
                                            <option value="48">轻</option>
                                            <option value="49">适中</option>
                                            <option value="50">偏重</option>
                                            <option value="51">重</option>
                                    </select>
                    </td>
    </tr>
    <tr>
        <th>功能指数</th>
        <td>
                            <select class="form-control" name="attr_id_83">
                    <option value="0">请选择</option>
                                            <option value="52">防水</option>
                                            <option value="53">保暖</option>
                                            <option value="54">抓地</option>
                                            <option value="55">速干</option>
                                    </select>
                    </td>
    </tr>
    <tr>
        <th>保暖指数</th>
        <td>
                            <select class="form-control" name="attr_id_84">
                    <option value="0">请选择</option>
                                            <option value="56">不保暖</option>
                                            <option value="57">保暖</option>
                                            <option value="58">超保暖</option>
                                    </select>
                    </td>
    </tr>
</table>
`;
        $('#propert_table').html(ret);


        //spec data
        var tempUrl2 = 'http://admin.dev.tnf.ibrand.cc/admin/store/goods/getSpecsData';
        var postData2 = {
            model_id: model_id,
            _token:$('meta[name="_token"]').attr('content')
        };

//        $.post(tempUrl2, postData2, function (ret) {
//            if(ret.status)
//            {
//                var specData = ret.data.specs;
//                window.skuBuilder.init(specData);
//
//            }
//        });


        var specData = {"status":true,"code":200,"message":"","data":{"specs":{"specs":[{"id":2,"label":"\u989c\u8272","type":2,"list":[{"id":1,"value":"\u9ed1\u8272","color":"000000"},{"id":2,"value":"\u7070\u8272","color":"6E6E6E"},{"id":3,"value":"\u767d\u8272","color":"FFFFFF"},{"id":4,"value":"\u7c73\u9ec4\u8272","color":"FFF3A6"},{"id":5,"value":"\u6df1\u7070\u8272","color":"454545"},{"id":6,"value":"\u5361\u5176\u8272","color":"B0853C"},{"id":7,"value":"\u4e2d\u9ec4","color":"FFE70D"},{"id":8,"value":"\u7c73\u7070\u8272","color":"FFFDCF"},{"id":9,"value":"\u6a59\u8272","color":"FF4400"},{"id":10,"value":"\u7c89\u7ea2\u8272","color":"FF85B1"},{"id":11,"value":"\u7ea2\u8272","color":"FF0000"},{"id":12,"value":"\u9152\u7ea2\u8272","color":"8A0000"},{"id":13,"value":"\u5496\u5561\u8272","color":"3B0000"},{"id":14,"value":"\u84dd\u8272","color":"1100FF"},{"id":15,"value":"\u6df1\u84dd\u8272","color":"0C007A"},{"id":16,"value":"\u6d45\u84dd\u8272","color":"4D70FF"},{"id":17,"value":"\u7d2b\u8272","color":"FA00D0"},{"id":18,"value":"\u7eff\u8272","color":"00FF11"},{"id":68,"value":"\u6df1\u7d2b","color":"710075"},{"id":69,"value":"\u84dd\u7eff\u8272","color":"00FFCC"},{"id":70,"value":"\u6df1\u84dd\u7eff","color":"009678"},{"id":71,"value":"\u68d5\u8272","color":"4F0000"},{"id":72,"value":"\u6df1\u5361\u5176","color":"694F24"},{"id":73,"value":"\u6731\u7ea2","color":"FF4D00"},{"id":74,"value":"\u67e0\u6aac\u9ec4","color":"E5FF00"},{"id":75,"value":"\u591a\u5f69\u8272","color":"1A0000"},{"id":76,"value":"\u8910\u8272","color":"A0522D"},{"id":77,"value":"\u6df1\u8349\u7eff","color":"5A781E"},{"id":85,"value":"\u8367\u5149\u7eff\u8272","color":"55FF00"},{"id":86,"value":"\u6df1\u7d2b\u8272","color":"7517B0"},{"id":91,"value":"\u519b\u7eff\u8272","color":"215E21"},{"id":92,"value":"\u6df1\u7ea2","color":"C40000"},{"id":93,"value":"\u6e56\u84dd","color":"1E90FF"},{"id":94,"value":"\u58a8\u7eff","color":"173D0A"},{"id":107,"value":"\u6df1\u68d5\u8272","color":"5E2612"},{"id":109,"value":"\u8367\u5149\u7eff","color":"68FF03"},{"id":110,"value":"\u73ab\u7ea2","color":"FE007F"},{"id":111,"value":"\u6df1\u6a59\u8272","color":"DB5300"},{"id":112,"value":"\u6de1\u7eff","color":"7AFF7A"},{"id":113,"value":"\u6de1\u9ec4\u8272","color":"F8FF2E"},{"id":114,"value":"\u94b4\u84dd","color":"3D59AB"},{"id":115,"value":"\u6df1\u73ab\u7ea2","color":"C20061"},{"id":116,"value":"\u6ca5\u9752\u8272","color":"00041C"},{"id":117,"value":"\u5b54\u96c0\u84dd","color":"03A89E"},{"id":118,"value":"\u82f9\u679c\u7eff","color":"64FF2B"},{"id":119,"value":"JK3","color":"0F0F0F"},{"id":122,"value":"B0E","color":"1900FF"},{"id":123,"value":"A3M","color":"F01616"},{"id":124,"value":"0C5","color":"666666"},{"id":125,"value":"A9T","color":"E7FF12"},{"id":126,"value":"G07","color":"FF1717"},{"id":127,"value":"B0T","color":"4D0000"},{"id":128,"value":"YD8","color":"0A0A0A"},{"id":129,"value":"KX9","color":"D6D6D6"},{"id":130,"value":"RR3","color":"AD0068"},{"id":131,"value":"ET8","color":"FFEF14"},{"id":132,"value":"A4M","color":"2919FF"},{"id":133,"value":"VB5","color":"FFDC2B"},{"id":134,"value":"B5T","color":"FFE019"},{"id":141,"value":"KX7","color":"3AFF1C"},{"id":142,"value":"C0V","color":"FFFDFC"},{"id":143,"value":"D1E","color":"780000"},{"id":144,"value":"A2E","color":"FF00D4"},{"id":145,"value":"A7B","color":"730013"},{"id":146,"value":"G9Q","color":"0B03FF"},{"id":147,"value":"1D7","color":"AD0EA3"},{"id":169,"value":"D7Q","color":"19FF21"},{"id":170,"value":"D3X","color":"3D0DFF"},{"id":171,"value":"E6F","color":"170FFF"},{"id":172,"value":"F7G","color":"2B1CFF"},{"id":173,"value":"2P4","color":"700000"},{"id":174,"value":"VB9","color":"17FF2E"},{"id":175,"value":"D1R","color":"2605FF"},{"id":179,"value":"E4D","color":"7A0072"},{"id":180,"value":"Z50","color":"55FF42"},{"id":181,"value":"D1T","color":"FF1C1C"},{"id":182,"value":"E6Y","color":"FF2A00"},{"id":183,"value":"9ZG","color":"ADADAD"},{"id":184,"value":"21L","color":"BFBFBF"}]},{"id":5,"label":"\u5c3a\u7801","type":1,"list":[{"id":334,"value":"36"},{"id":335,"value":"36.5"},{"id":336,"value":"37"},{"id":337,"value":"37.5"},{"id":338,"value":"38"},{"id":339,"value":"38.5"},{"id":340,"value":"39"},{"id":341,"value":"39.5"},{"id":342,"value":"40"}]}],"skus":{"skuData":[],"specData":[]}}}};

        window.skuBuilder.init({
            "specs": [
                {
                    "id": 1,
                    "label": "尺码",
                    "type": 1,
                    "list": [
                        {
                            "id": 19,
                            "value": "均码"
                        },
                        {
                            "id": 20,
                            "value": "XXS"
                        },
                        {
                            "id": 21,
                            "value": "XS"
                        },
                        {
                            "id": 22,
                            "value": "S"
                        },
                        {
                            "id": 23,
                            "value": "M"
                        },
                        {
                            "id": 24,
                            "value": "L"
                        },
                        {
                            "id": 25,
                            "value": "XL"
                        },
                        {
                            "id": 26,
                            "value": "XXL"
                        },
                        {
                            "id": 27,
                            "value": "34"
                        },
                        {
                            "id": 28,
                            "value": "35"
                        },
                        {
                            "id": 29,
                            "value": "36"
                        },
                        {
                            "id": 30,
                            "value": "37"
                        },
                        {
                            "id": 31,
                            "value": "38"
                        },
                        {
                            "id": 32,
                            "value": "39"
                        },
                        {
                            "id": 33,
                            "value": "40"
                        },
                        {
                            "id": 34,
                            "value": "41"
                        },
                        {
                            "id": 35,
                            "value": "42"
                        },
                        {
                            "id": 36,
                            "value": "43"
                        },
                        {
                            "id": 37,
                            "value": "44"
                        },
                        {
                            "id": 38,
                            "value": "45"
                        },
                        {
                            "id": 60,
                            "value": "38.5"
                        },
                        {
                            "id": 61,
                            "value": "39.5"
                        },
                        {
                            "id": 63,
                            "value": "36.5"
                        },
                        {
                            "id": 64,
                            "value": "37.5"
                        },
                        {
                            "id": 65,
                            "value": "40.5"
                        },
                        {
                            "id": 66,
                            "value": "41.5"
                        },
                        {
                            "id": 67,
                            "value": "42.5"
                        },
                        {
                            "id": 83,
                            "value": "30"
                        },
                        {
                            "id": 84,
                            "value": "32"
                        },
                        {
                            "id": 95,
                            "value": "XXXL"
                        },
                        {
                            "id": 96,
                            "value": "4"
                        },
                        {
                            "id": 97,
                            "value": "6"
                        },
                        {
                            "id": 98,
                            "value": "8"
                        },
                        {
                            "id": 99,
                            "value": "10"
                        },
                        {
                            "id": 100,
                            "value": "12"
                        },
                        {
                            "id": 101,
                            "value": "2"
                        },
                        {
                            "id": 102,
                            "value": "14"
                        },
                        {
                            "id": 104,
                            "value": "30"
                        },
                        {
                            "id": 105,
                            "value": "32"
                        },
                        {
                            "id": 106,
                            "value": "32"
                        },
                        {
                            "id": 108,
                            "value": "43.5"
                        },
                        {
                            "id": 120,
                            "value": "S\/M"
                        },
                        {
                            "id": 121,
                            "value": "L\/X"
                        },
                        {
                            "id": 135,
                            "value": "2"
                        },
                        {
                            "id": 136,
                            "value": "4"
                        },
                        {
                            "id": 137,
                            "value": "6"
                        },
                        {
                            "id": 138,
                            "value": "8"
                        },
                        {
                            "id": 139,
                            "value": "10"
                        },
                        {
                            "id": 140,
                            "value": "12"
                        },
                        {
                            "id": 148,
                            "value": "44.5"
                        },
                        {
                            "id": 176,
                            "value": "均码"
                        },
                        {
                            "id": 177,
                            "value": "均码"
                        },
                        {
                            "id": 178,
                            "value": "均码"
                        },
                        {
                            "id": 199,
                            "value": "0"
                        },
                        {
                            "id": 200,
                            "value": "14"
                        },
                        {
                            "id": 201,
                            "value": "30"
                        },
                        {
                            "id": 202,
                            "value": "32"
                        },
                        {
                            "id": 203,
                            "value": "34"
                        },
                        {
                            "id": 204,
                            "value": "36"
                        },
                        {
                            "id": 205,
                            "value": "38"
                        },
                        {
                            "id": 206,
                            "value": "4"
                        },
                        {
                            "id": 220,
                            "value": "6"
                        },
                        {
                            "id": 221,
                            "value": "8"
                        },
                        {
                            "id": 222,
                            "value": "10"
                        },
                        {
                            "id": 223,
                            "value": "12"
                        },
                        {
                            "id": 224,
                            "value": "14"
                        },
                        {
                            "id": 247,
                            "value": "0"
                        },
                        {
                            "id": 248,
                            "value": "007"
                        },
                        {
                            "id": 249,
                            "value": "008"
                        },
                        {
                            "id": 250,
                            "value": "009"
                        },
                        {
                            "id": 251,
                            "value": "010"
                        },
                        {
                            "id": 252,
                            "value": "011"
                        },
                        {
                            "id": 276,
                            "value": "S"
                        },
                        {
                            "id": 277,
                            "value": "XXL"
                        },
                        {
                            "id": 278,
                            "value": "XL"
                        },
                        {
                            "id": 279,
                            "value": "L"
                        },
                        {
                            "id": 280,
                            "value": "M"
                        },
                        {
                            "id": 281,
                            "value": "M"
                        },
                        {
                            "id": 282,
                            "value": "S"
                        },
                        {
                            "id": 283,
                            "value": "XXL"
                        },
                        {
                            "id": 284,
                            "value": "XL"
                        },
                        {
                            "id": 285,
                            "value": "L"
                        },
                        {
                            "id": 286,
                            "value": "M"
                        },
                        {
                            "id": 287,
                            "value": "2"
                        },
                        {
                            "id": 290,
                            "value": "010"
                        },
                        {
                            "id": 291,
                            "value": "020"
                        },
                        {
                            "id": 292,
                            "value": "030"
                        },
                        {
                            "id": 293,
                            "value": "040"
                        },
                        {
                            "id": 294,
                            "value": "050"
                        },
                        {
                            "id": 295,
                            "value": "060"
                        },
                        {
                            "id": 302,
                            "value": "012"
                        },
                        {
                            "id": 303,
                            "value": "013"
                        },
                        {
                            "id": 304,
                            "value": "1"
                        },
                        {
                            "id": 305,
                            "value": "2"
                        },
                        {
                            "id": 306,
                            "value": "3"
                        },
                        {
                            "id": 307,
                            "value": "4"
                        },
                        {
                            "id": 308,
                            "value": "6"
                        },
                        {
                            "id": 309,
                            "value": "5"
                        },
                        {
                            "id": 310,
                            "value": "44.5"
                        },
                        {
                            "id": 313,
                            "value": "090"
                        },
                        {
                            "id": 314,
                            "value": "31升"
                        },
                        {
                            "id": 315,
                            "value": "56-75升"
                        },
                        {
                            "id": 316,
                            "value": "20-35升"
                        },
                        {
                            "id": 448,
                            "value": "21升"
                        },
                        {
                            "id": 451,
                            "value": "15升"
                        },
                        {
                            "id": 453,
                            "value": "帽围 48cm"
                        },
                        {
                            "id": 467,
                            "value": "2升"
                        }
                    ]
                },
                {
                    "id": 2,
                    "label": "颜色",
                    "type": 2,
                    "list": [
                        {
                            "id": 1,
                            "value": "黑色",
                            "color": "000000"
                        },
                        {
                            "id": 2,
                            "value": "灰色",
                            "color": "6E6E6E"
                        },
                        {
                            "id": 3,
                            "value": "白色",
                            "color": "FFFFFF"
                        },
                        {
                            "id": 4,
                            "value": "米黄色",
                            "color": "FFF3A6"
                        },
                        {
                            "id": 5,
                            "value": "深灰色",
                            "color": "454545"
                        },
                        {
                            "id": 6,
                            "value": "卡其色",
                            "color": "B0853C"
                        },
                        {
                            "id": 7,
                            "value": "中黄",
                            "color": "FFE70D"
                        },
                        {
                            "id": 8,
                            "value": "米灰色",
                            "color": "FFFDCF"
                        },
                        {
                            "id": 9,
                            "value": "橙色",
                            "color": "FF4400"
                        },
                        {
                            "id": 10,
                            "value": "粉红色",
                            "color": "FF85B1"
                        },
                        {
                            "id": 11,
                            "value": "红色",
                            "color": "FF0000"
                        },
                        {
                            "id": 12,
                            "value": "酒红色",
                            "color": "8A0000"
                        },
                        {
                            "id": 13,
                            "value": "咖啡色",
                            "color": "3B0000"
                        },
                        {
                            "id": 14,
                            "value": "蓝色",
                            "color": "1100FF"
                        },
                        {
                            "id": 15,
                            "value": "深蓝色",
                            "color": "0C007A"
                        },
                        {
                            "id": 16,
                            "value": "浅蓝色",
                            "color": "4D70FF"
                        },
                        {
                            "id": 17,
                            "value": "紫色",
                            "color": "FA00D0"
                        },
                        {
                            "id": 18,
                            "value": "绿色",
                            "color": "00FF11"
                        },
                        {
                            "id": 68,
                            "value": "深紫",
                            "color": "710075"
                        },
                        {
                            "id": 69,
                            "value": "蓝绿色",
                            "color": "00FFCC"
                        },
                        {
                            "id": 70,
                            "value": "深蓝绿",
                            "color": "009678"
                        },
                        {
                            "id": 71,
                            "value": "棕色",
                            "color": "4F0000"
                        },
                        {
                            "id": 72,
                            "value": "深卡其",
                            "color": "694F24"
                        },
                        {
                            "id": 73,
                            "value": "朱红",
                            "color": "FF4D00"
                        },
                        {
                            "id": 74,
                            "value": "柠檬黄",
                            "color": "E5FF00"
                        },
                        {
                            "id": 75,
                            "value": "多彩色",
                            "color": "1A0000"
                        },
                        {
                            "id": 76,
                            "value": "褐色",
                            "color": "A0522D"
                        },
                        {
                            "id": 77,
                            "value": "深草绿",
                            "color": "5A781E"
                        },
                        {
                            "id": 85,
                            "value": "荧光绿色",
                            "color": "55FF00"
                        },
                        {
                            "id": 86,
                            "value": "深紫色",
                            "color": "7517B0"
                        },
                        {
                            "id": 91,
                            "value": "军绿色",
                            "color": "215E21"
                        },
                        {
                            "id": 92,
                            "value": "深红",
                            "color": "C40000"
                        },
                        {
                            "id": 93,
                            "value": "湖蓝",
                            "color": "1E90FF"
                        },
                        {
                            "id": 94,
                            "value": "墨绿",
                            "color": "173D0A"
                        },
                        {
                            "id": 107,
                            "value": "深棕色",
                            "color": "5E2612"
                        },
                        {
                            "id": 109,
                            "value": "荧光绿",
                            "color": "68FF03"
                        },
                        {
                            "id": 110,
                            "value": "玫红",
                            "color": "FE007F"
                        },
                        {
                            "id": 111,
                            "value": "深橙色",
                            "color": "DB5300"
                        },
                        {
                            "id": 112,
                            "value": "淡绿",
                            "color": "7AFF7A"
                        },
                        {
                            "id": 113,
                            "value": "淡黄色",
                            "color": "F8FF2E"
                        },
                        {
                            "id": 114,
                            "value": "钴蓝",
                            "color": "3D59AB"
                        },
                        {
                            "id": 115,
                            "value": "深玫红",
                            "color": "C20061"
                        },
                        {
                            "id": 116,
                            "value": "沥青色",
                            "color": "00041C"
                        },
                        {
                            "id": 117,
                            "value": "孔雀蓝",
                            "color": "03A89E"
                        },
                        {
                            "id": 118,
                            "value": "苹果绿",
                            "color": "64FF2B"
                        },
                        {
                            "id": 119,
                            "value": "JK3",
                            "color": "0F0F0F"
                        },
                        {
                            "id": 122,
                            "value": "B0E",
                            "color": "1900FF"
                        },
                        {
                            "id": 123,
                            "value": "A3M",
                            "color": "F01616"
                        },
                        {
                            "id": 124,
                            "value": "0C5",
                            "color": "666666"
                        },
                        {
                            "id": 125,
                            "value": "A9T",
                            "color": "E7FF12"
                        },
                        {
                            "id": 126,
                            "value": "G07",
                            "color": "FF1717"
                        },
                        {
                            "id": 127,
                            "value": "B0T",
                            "color": "4D0000"
                        },
                        {
                            "id": 128,
                            "value": "YD8",
                            "color": "0A0A0A"
                        },
                        {
                            "id": 129,
                            "value": "KX9",
                            "color": "D6D6D6"
                        },
                        {
                            "id": 130,
                            "value": "RR3",
                            "color": "AD0068"
                        },
                        {
                            "id": 131,
                            "value": "ET8",
                            "color": "FFEF14"
                        },
                        {
                            "id": 132,
                            "value": "A4M",
                            "color": "2919FF"
                        },
                        {
                            "id": 133,
                            "value": "VB5",
                            "color": "FFDC2B"
                        },
                        {
                            "id": 134,
                            "value": "B5T",
                            "color": "FFE019"
                        },
                        {
                            "id": 141,
                            "value": "KX7",
                            "color": "3AFF1C"
                        },
                        {
                            "id": 142,
                            "value": "C0V",
                            "color": "FFFDFC"
                        },
                        {
                            "id": 143,
                            "value": "D1E",
                            "color": "780000"
                        },
                        {
                            "id": 144,
                            "value": "A2E",
                            "color": "FF00D4"
                        },
                        {
                            "id": 145,
                            "value": "A7B",
                            "color": "730013"
                        },
                        {
                            "id": 146,
                            "value": "G9Q",
                            "color": "0B03FF"
                        },
                        {
                            "id": 147,
                            "value": "1D7",
                            "color": "AD0EA3"
                        },
                        {
                            "id": 169,
                            "value": "D7Q",
                            "color": "19FF21"
                        },
                        {
                            "id": 170,
                            "value": "D3X",
                            "color": "3D0DFF"
                        },
                        {
                            "id": 171,
                            "value": "E6F",
                            "color": "170FFF"
                        },
                        {
                            "id": 172,
                            "value": "F7G",
                            "color": "2B1CFF"
                        },
                        {
                            "id": 173,
                            "value": "2P4",
                            "color": "700000"
                        },
                        {
                            "id": 174,
                            "value": "VB9",
                            "color": "17FF2E"
                        },
                        {
                            "id": 175,
                            "value": "D1R",
                            "color": "2605FF"
                        },
                        {
                            "id": 179,
                            "value": "E4D",
                            "color": "7A0072"
                        },
                        {
                            "id": 180,
                            "value": "Z50",
                            "color": "55FF42"
                        },
                        {
                            "id": 181,
                            "value": "D1T",
                            "color": "FF1C1C"
                        },
                        {
                            "id": 182,
                            "value": "E6Y",
                            "color": "FF2A00"
                        },
                        {
                            "id": 183,
                            "value": "9ZG",
                            "color": "ADADAD"
                        },
                        {
                            "id": 184,
                            "value": "21L",
                            "color": "BFBFBF"
                        }
                    ]
                }
            ],
            "skus": {
                "skuData": [
                    {
                        "id": 24897,
                        "sell_price": "100.00",
                        "store_nums": 7,
                        "sku": "2425245",
                        "is_show": 1,
                        "specID": [
                            "1",
                            "19"
                        ],
                        "market_price": "122.00"
                    },
                    {
                        "id": 24899,
                        "sell_price": "100.00",
                        "store_nums": 11,
                        "sku": "e232",
                        "is_show": 1,
                        "specID": [
                            "11",
                            "19"
                        ],
                        "market_price": "122.00"
                    },
                    {
                        "id": 24903,
                        "sell_price": "100.00",
                        "store_nums": 11,
                        "sku": "5665565",
                        "is_show": 1,
                        "specID": [
                            "1",
                            "24"
                        ],
                        "market_price": "122.00"
                    },
                    {
                        "id": 24905,
                        "sell_price": "100.00",
                        "store_nums": 11,
                        "sku": "77777",
                        "is_show": 1,
                        "specID": [
                            "11",
                            "24"
                        ],
                        "market_price": "122.00"
                    },
                    {
                        "id": 24911,
                        "sell_price": "100.00",
                        "store_nums": 22,
                        "sku": "343",
                        "is_show": 1,
                        "specID": [
                            "1",
                            "21"
                        ],
                        "market_price": "100.00"
                    },
                    {
                        "id": 24912,
                        "sell_price": "100.00",
                        "store_nums": 333,
                        "sku": "212",
                        "is_show": 1,
                        "specID": [
                            "11",
                            "21"
                        ],
                        "market_price": "100.00"
                    }
                ],
                "specData": {
                    "19": {
                        "value": "均码"
                    },
                    "1": {
                        "value": "黑色",
                        "color": "#000000"
                    },
                    "24": {
                        "value": "L"
                    },
                    "11": {
                        "value": "红色",
                        "color": "#FF0000"
                    },
                    "21": {
                        "value": "XS"
                    }
                }
            }
        });
    }
</script>

<script type="text/html" id="template">
    <div class="category-wrap">
        <input data-id="{#id#}" data-parent="{#parent_id#}" data-name="{#value#}" data-uniqueId="categoryIds_{#id#}" class="category_checks" type="checkbox" />
        &nbsp;&nbsp;&nbsp;
        <input class="btn btn-outline btn-primary category-btn" type="button" value="{#value#}" />
    </div>
</script>

<script>
    $(function(){
        var category_checked = [];
        var category_ids = [];
        // 初始化
        $("select[name=category_group]").change(function () {

            var groupID = $(this).children('option:selected').val();
            category_checked = [];
            category_ids = [];
            var data = {
                id:groupID,
                _token:$('meta[name="_token"]').attr('content')
            };
            if (groupID) {
                $.post('http://admin.dev.tnf.ibrand.cc/admin/store/goods/get_category', data, function (html) {
                    $('#category-box').children().remove();
                    $('#category-box').append(html);
                    $('#category-box').find("input").iCheck({
                        checkboxClass: 'icheckbox_square-green',
                        radioClass: 'iradio_square-green',
                        increaseArea: '20%'
                    });
                });
            }
        });

        $("#hidden-category-id input").each(function(){
            category_ids.push(parseInt($(this).val()));
        });
        category_checked = $(".category_name").text().split("/");

        //  $(".category_name").html(category_checked.join("/"));
        initTheOrderCheckedCats();

        function moveTheOrderCat($parentObject, template){
            if($parentObject.length == 1){
                $parentObject.children('ul').append(template);
            }else{
                $(".category_name").children('ul').append(template);
            }
        }

        function initTheOrderCheckedCats(){
            $(".category_name li").each(function(){
                var parentId = $(this).data('parent');
                var $parentObject = $(".category_name").find('[data-id='+parentId+']');
                moveTheOrderCat($parentObject, $(this));
            });
        }
        function addTheOrderCheckedCat(dataId, dataParentId, dataName){
            var whetherExistNode = $(".category_name").find('[data-id='+dataId+']').length;
            if(0 == whetherExistNode){
                var template = " <li data-id="+ dataId +" data-parent="+dataParentId +"><span>"+ dataName +
                    "</span><ul></ul>"+
                    " </li>";
                var $parentObject = $(".category_name").find('[data-id='+dataParentId+']');
                moveTheOrderCat($parentObject, template);
            }
        }
        function removeTheOrderCheckedCat(dataId){
            var $node = $(".category_name").find('[data-id='+dataId+']');
            var $childrenNode = $node.children('ul').children();
            if($childrenNode.length > 0){
                var $nodeParent = $node.parents('li').first();
                moveTheOrderCat($nodeParent, $childrenNode);
            }
            $node.remove();
        }

        function operator($object, parentId, parentName, flag){
            // $flag =1 表示checked操作， $flag=2 表示unchecked操作， $flag=3表示点击钮
            // $object 表示 category-content类对象

            // 首先 写unchecked操作
            if(2 == flag){
                // 在category_ids里面找parentId
                var positionIndex = category_ids.indexOf(parentId);
                category_ids.splice(positionIndex, 1);

                // 同上， 将parentName从category_checked中移除
                positionIndex = category_checked.indexOf(parentName);
                category_checked.splice(positionIndex, 1);

                //将表单中的hidden 某个category_id移除
                $("#hidden-category-id").find("#category_" + parentId).remove();
            }else{
                // 在flag =1 或者 flag=3时 一定会向后台请求数据
                // html
                var html = "";
                var groupId = $("select[name=category_group]").children('option:selected').val();
                var data = {
                    "parentId": parentId,
                    "groupId": groupId,
                    "type-click-category-button": true,
                };
                $.post(
                    "http://admin.dev.tnf.ibrand.cc/admin/store/goods/get_category", data,
                    function (json) {

                        for (var i = 0; i < json.length; i++) {

                            var data = {
                                id: json[i].id,
                                value: json[i].name,
                                parent_id: json[i].parent_id,
                            }
                            html = html + $.convertTemplate('#template', data, '');
                        }
                        // 异步请求后， 模板数据全都存在于var html中 下一步获得 类为 category-content的位置 这里有个bug,  应该要放进 ajax里面
                        var categoryContentPosition = $object.data('position');

                        if(categoryContentPosition != "right"){
                            // categoryContentPosition 不等于 right 找到它的next sibling
                            var $nextObject = $object.next();
                            // 首先将 $nextObject里面的内容清空
                            $nextObject.children().remove();
                            $nextObject.append(html);
                            // debugger;
                            $(".category_checks").iCheck({checkboxClass: 'icheckbox_square-green'});
                            //将id存在于 category_ids里的 checkbox checked
                            for (var i = 0; i < category_ids.length; i++) {
                                $("input[data-uniqueId=categoryIds_" + category_ids[i] + "]").iCheck('check');
                            }
                        }
                        if(1== flag){
                            parentId = parseInt(parentId);
                            if(category_ids.indexOf(parentId) < 0){
                                category_ids.push(parentId);
                                category_checked.push(parentName);
                                $("#hidden-category-id").append("<input  type=\"hidden\" name=\"category_id[]\" id=category_" + parentId + " value=" + parentId + ">");
                            }
                        }
                    });
            }
        }

        $('body').on('click', '.category-btn', function(){
            // 获得相邻的checkbox
            var $checkbox = $(this).prev().find(':checkbox');
            var id = $checkbox.data('id');
            var name = $checkbox.data('name');
            var $parentCategoryContent = $checkbox.closest('.category-content');
            operator($parentCategoryContent, id, name, 3);
        });
        $('body').on('ifChanged', '.category_checks', function(){
            var id = $(this).data('id');
            var name = $(this).data('name');
            var parentId = $(this).data('parent');
            var $parentCategoryContent = $(this).closest('.category-content');
            if($(this).is(':checked')){
                operator($parentCategoryContent, id, name, 1);
                addTheOrderCheckedCat(id, parentId, name);
            }else{
                operator($parentCategoryContent, id, name, 2);
                removeTheOrderCheckedCat(id);
            }
        });
    });
</script>


<script>
    $(document).ready(function () {
        /*setTimeout(function () {
         toastr.options = {
         closeButton: true,
         progressBar: true,
         showMethod: 'slideDown',
         timeOut: 4000
         };
         toastr.success('天善智能 BI 和大数据社区', '欢迎使用');

         }, 1300);*/
    });
</script>

<script>
    var options = {
        success: callResponse
    }
    $('#resetPasswordForm').submit(function(){
        $(this).ajaxSubmit(options);
        return false;
    });

    function callResponse(response){
        if(!response.status){
            $data = "<div class=\"alert alert-info\" id=\"alert-reset-password\"><a class=\"close\" data-dismiss=\"alert\">×</a>"+response.message +" </div> ";

            $('.modal-body').prepend($data);
        }else{
            $('#resetPassword').modal('hide');
        }
    }

    $('input').focus(function(){
        $('.alert-info').alert('close');
    });

</script>

</body>
</html>
